package com.codebattery.controller;

import com.codebattery.service.FlashSaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class FalshSaleController {

    @Autowired
    private FlashSaleService flashSaleService;

    @RequestMapping(value = "/falsh-sale", method = RequestMethod.POST, produces = "application/json")
    public String flashSale(String userId, String goodsId) throws Exception {

        return flashSaleService.sale(userId, goodsId);
    }
}
